<template>
  <div class="app">
    <!-- inline表示在同一行显示 -->
    <el-container
      style="box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04)"
    >
      <el-header style="height:170px;">
        <search-area ref="searchArea" @searchSubmit="handleSearchResult" />
      </el-header>
      <el-main> <table-area ref="tableArea" @searchAgain="handleSearchAgain"/></el-main>
    </el-container>
  </div>
</template>

<script>
import searchArea from "./courseInfo/searchArea";
import tableArea from "./courseInfo/tableArea";
export default {
  name: "courseInfo",
  components: { searchArea, tableArea },
  data() {
    return {};
  },
  methods:{
    handleSearchResult(result){
      this.$refs.tableArea.allItems = result
      this.$refs.tableArea.handleCurrentChange(1)
    },
    handleSearchAgain(){
      this.$refs.searchArea.submit()
    }
  }
};
</script>

<style scoped></style>
